-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coverage integration test for requirements #152
base: main
Are you sure you want to change the base?
Coverage integration test for requirements #152
Conversation
four different coverage tests have been added
600c9e5
to
fc04145
Compare
156fa3c
to
46c3030
Compare
four different coverage tests have been added
9483724
to
a7ac888
Compare
...alid-source-input-file-paths/invalid-directory-input-scenario/expected-output/output.lobster
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments in above Makefile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments in above Makefile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments in above Makefile
THIS_TEST_ESCAPED:=$(subst /,\\/,$(THIS_TEST)) | ||
REFERENCE_OUTPUT:=report.reference_output | ||
|
||
html_report.html: softreq.lobster sysreq.lobster lobster.conf trlc-softreq.conf trlc-sysreq.conf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this make target calls lobster-report
, and hence no file called html_report.html
will ever be generated.
Did you mean lobster.report
instead?
@if diff report.lobster $(REFERENCE_OUTPUT); then \ | ||
echo "Files are identical"; \ | ||
else \ | ||
echo "Files are different"; \ | ||
exit 1; \ | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix the indentation
html_report.html: softreq.lobster sysreq.lobster testreq.lobster lobster.conf trlc-softreq.conf trlc-sysreq.conf trlc-testreq.conf | ||
@lobster-report | ||
@if diff report.lobster $(REFERENCE_OUTPUT); then \ | ||
echo "Files are identical"; \ | ||
else \ | ||
echo "Files are different"; \ | ||
exit 1; \ | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above:
- no file called
html_report.html
will ever be generated; you probably meantreport.lobster
- please fix the indentation
text String | ||
derived_from optional Software_Requirement [1 .. *] | ||
just_up optional String | ||
just_down optional String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you introduce just_down
? The tracing policy in lobster.conf
shows that "Test Requirements" are on the lowest level. There is no level beneath them. just_down
can never have any impact in this test setup. Or did you want to verify this fact?
text = '''Requirement3''' | ||
derived_from = [softreq_coverage_half_example.requirement_d] | ||
just_up = "needed" | ||
just_down = "needed" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just_down
will not have any impact in this test. It can be removed.
html_report.html: softreq.lobster sysreq.lobster lobster.conf trlc-softreq.conf trlc-sysreq.conf | ||
@lobster-report | ||
@if diff report.lobster $(REFERENCE_OUTPUT); then \ | ||
echo "Files are identical"; \ | ||
else \ | ||
echo "Files are different"; \ | ||
exit 1; \ | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above:
- no file called
html_report.html
will ever be generated; you probably meantreport.lobster
- please fix the indentation
html_report.html: softreq.lobster sysreq.lobster lobster.conf trlc-softreq.conf trlc-sysreq.conf | ||
@lobster-report | ||
@if diff report.lobster $(REFERENCE_OUTPUT); then \ | ||
echo "Files are identical"; \ | ||
else \ | ||
echo "Files are different"; \ | ||
exit 1; \ | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above:
- no file called
html_report.html
will ever be generated; you probably meantreport.lobster
- please fix the indentation
@if diff report.lobster $(REFERENCE_OUTPUT); then \ | ||
echo "Files are identical"; \ | ||
else \ | ||
echo "Files are different"; \ | ||
exit 1; \ | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@if diff report.lobster $(REFERENCE_OUTPUT); then \ | |
echo "Files are identical"; \ | |
else \ | |
echo "Files are different"; \ | |
exit 1; \ | |
fi | |
@if diff report.lobster $(REFERENCE_OUTPUT); then echo '✅ Files are identical!'; else { echo '❌ ERROR: Files are different!'; exit 1; }; fi |
@if diff report.lobster $(REFERENCE_OUTPUT); then \ | ||
echo "Files are identical"; \ | ||
else \ | ||
echo "Files are different"; \ | ||
exit 1; \ | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@if diff report.lobster $(REFERENCE_OUTPUT); then \ | ||
echo "Files are identical"; \ | ||
else \ | ||
echo "Files are different"; \ | ||
exit 1; \ | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@if diff report.lobster $(REFERENCE_OUTPUT); then \ | ||
echo "Files are identical"; \ | ||
else \ | ||
echo "Files are different"; \ | ||
exit 1; \ | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,12 @@ | |||
package coverage_example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Package names in the rsl files are same and it shows the following error message
duplicate definition, previous definition at tests-integration/projects/coverage-half/example.rsl:1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for clarification: it is okay to have duplicates across different test cases. But if you use the TRLC extension for VSCode, and if it scans the whole repository, then it will complain about duplicated definitions.
@@ -0,0 +1,12 @@ | |||
package coverage_example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requirements "Software Requirements" | ||
{ | ||
source: "softreq.lobster"; | ||
requires: "Test Requirements"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add the requires
keyword here? Since "Test Requirements" already use trace to: "Software Requirements";
it will not impact the tool behavior. Or was the idea to test exactly that the statement has no impact?
After investigation it seems that lobster-report
behaves like follows (but should not):
- if
requires
is specified for a level (here: "Software Requirements"), then any implicit conditions imposed throughtrace to
coming from other levels are ignored. - That's why the coverage is 100%, where it should really be 0%.
Recommendation:
The integration tests shall focus on the trace to
feature only. Please remove requires
from the tests. The behavior of requires
will be replaced by a new feature called trace from
with pull request #91 anyway.
{ | ||
text = '''Requirement3''' | ||
derived_from = [softreq_coverage_half_example.requirement_d] | ||
just_up = "needed" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you give a justification in this test, while adding a link to requirement_d
at the same time?
"status": null | ||
} | ||
], | ||
"coverage": 100.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The requirement_d
is not linked to any requirement from level "System Requirements", but the tracing policy enforces that through trace to
. As stated above, the requires
keyword apparently removes this strict condition, which is a bug. Please do not use requires
in the tests, and set the expected coverage to 0
here.
@@ -0,0 +1,22 @@ | |||
package coverage_half_example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test case is called coverage-mix
, not coverage_half_example
. It is very confusing to give the TRLC package the name of a different test case.
|
||
requirements "System Requirements" { | ||
source: "sysreq.lobster"; | ||
trace to: "Software Requirements"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is very confusing to derive system requirements from software requirements. Please consider to either switch the names, or use made-up names like "Apple", "Banana", etc. instead!
type Software_Requirement | ||
{ | ||
text String | ||
derived_from optional System_Requirement [1 .. *] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The one requirement in softreq_example.trlc
does not use the attribute derived_from
at all. It can be removed.
Furthermore, the example.rsl
demands that the breakdown happens the other way around, from software requirements to system requirements.
Please keep the test as simple as possible, and don't pollute it with configuration aspects that are not important to the test.
No description provided.